package com.demo11;

import java.util.Date;

/**
 * Created by Administrator on 2017/4/15.
 */
public class Eval {
    public static void main(String[] args) {
        Date date = new Date();
        String year = String.format("%tY", date);
        String month = String.format("%tB", date);
        String day = String.format("%td", date);
        System.out.println("今年是: " + year + "年");
        System.out.println("现在是: " + month);
        System.out.println("今天是: " + day + "号");
        System.out.println("---end---");
        Date date2 = new Date();
        String hour = String.format("%tH", date2);
        String minute = String.format("%tM", date2);
        String second = String.format("%tS", date2);
        System.out.println("现在是: " + hour + "时" + minute + "分" + second + "秒");
        System.out.println("---end---");
        Date date3 = new Date();
        String time = String.format("%tc", date3);
        String form = String.format("%tF", date3);
        System.out.println("全部的时间信息是: " + time);
        System.out.println("年-月-日格式: " + form);
    }
}
